package com.wang.lotterysystem.common.exception;

import com.wang.lotterysystem.common.errorcode.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)//需要加上这个注解来使用父类中的EqualsAndHashCode
public class ControllerException extends RuntimeException{
    private Integer code;
    private String msg;
    public ControllerException(){
    }
    public ControllerException(ErrorCode errorCode){
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
    public ControllerException(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }
}